home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / bc_ti.zip / TI808.ASC < prev    next >
Text File  |  1992-02-25  |  2KB  |  67 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Turbo C++                              NUMBER  :  808
  9.   VERSION  :  1.01
  10.        OS  :  DOS
  11.      DATE  :  February 25, 1992                        PAGE  :  1/1
  12.  
  13.     TITLE  :  Rules for Compiler Generated Constructors
  14.  
  15.  
  16.  
  17.  
  18.   The C++ language provides constructors when none are defined.
  19.   Here are the rules used by the Turbo C++ compiler to generate
  20.   such constructors:
  21.  
  22.   The default constructor T::T() is automatically defined if there
  23.   are no constructors explicitly provided in the class definition.
  24.  
  25.   The copy constructor T::T(constT&) or T::(T&) is automatically
  26.   defined if there is not a copy constructor explicitly provided in
  27.   the class definition.  The copy constructor will call the copy
  28.   constructor of all base classes and member functions. It uses the
  29.   const form if it can, and the non-const form otherwise.
  30.  
  31.   The assignment operator T& T::operator= (const T&) or (T&) is
  32.   defined if there is not an 'operator=' defined that has a 'T' or
  33.   'T&' as one of its arguments.
  34.  
  35.   The copy constructor is not generated if there is a constructor
  36.   that can be called with a 'T' as its only argument.
  37.  
  38.   The 'operator=' is not generated if there is a form with a 'T' as
  39.   any argument.
  40.  
  41.   The copy constructor (or operator=) is called member-wise in the
  42.   generated version of these functions.  If there is a member with
  43.   a private copy constructor (or operator=) than the FUNCTION is
  44.   not generated.  I think that is not quite correct-- it ought to
  45.   work if this class is a FRIEND of that class.  Also, the
  46.   operator= is not defined unless it is actually used.
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.